package com.bjpowernode.boss.mvc.models.form.user;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 用户新增/编辑的表单数据类
 *
 * @author yu
 * @date 2024/7/10  11:42
 */

@Data
public class UserEditForm {

    private String id ;

    @NotNull(message = "缺失登录名称")
    private String loginName ;

    @NotNull(message = "缺失联系方式")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    private String phone ;

    @NotNull(message = "缺失商户名称")
    @Size(min = 5, max = 20, message = "商户名称长度为5-20个字符")
    private String shopName ;

    @NotNull(message = "缺失经营范围")
    @Size(min = 10, max = 80, message = "经营范围长度为10-80个字符")
    private String shopScope ;

    @NotNull(message = "缺失联系邮箱")
    @Email(message = "邮箱格式错误")
    private String email ;
}
